Skip to content

bpo-36888: Increase timeout in test_parent_process#14286

Merged
vstinner merged 1 commit into
python:masterfrom
pierreglaser:increase-timeout-parent-process-tests
Jun 25, 2019
Merged

bpo-36888: Increase timeout in test_parent_process#14286
vstinner merged 1 commit into
python:masterfrom
pierreglaser:increase-timeout-parent-process-tests

Conversation

@pierreglaser
Copy link
Copy Markdown
Contributor

@pierreglaser pierreglaser commented Jun 21, 2019

Attempt to fix the buildbot failures reported in the original bpo issue.

We (@tomMoral and I) suspect that the AssertionError comes from the child process and the grand-child processes taking more than 5 seconds to get up and running, making the following calls to rconn.poll(timeout=5) return False.

The proposed fix here is therefore to give more time for the child processes to start by increasing the timeout in the rconn.poll calls.

We also increase the life-span of the child process to make sure the it is not dead when the grand-child process starts executing.

cc @vstinner :)

https://bugs.python.org/issue36888

@tomMoral
Copy link
Copy Markdown
Contributor

I agree this looks like an issue due to timeout that are too short. This PR should fix this.

Copy link
Copy Markdown
Member

@vstinner vstinner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test_parent_process() seems to be designed around time. That's a very weird synchronization primitation, it's not reliable at all. Can't you use another more reliable synchronization primitive? Something like https://docs.python.org/dev/library/multiprocessing.html#multiprocessing.Event?

cc @pablogsal

@bedevere-bot
Copy link
Copy Markdown

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

@tomMoral
Copy link
Copy Markdown
Contributor

The synchronization here does not rely on time bu is done thru the multiprocessing.Pipe object which is used as a communication channel. The timeout are only here to safeguard against hanged interpreters. Using mp.Event would lead to very similar code, as to avoid frozen interpreters, we would need to rely on Event.wait with non-zero timeout, which would be equivalent to the poll with non-zero timeout.

@vstinner vstinner merged commit 594d9b9 into python:master Jun 25, 2019
@miss-islington
Copy link
Copy Markdown
Contributor

Thanks @pierreglaser for the PR, and @vstinner for merging it 🌮🎉.. I'm working now to backport this PR to: 3.8.
🐍🍒⛏🤖

@bedevere-bot
Copy link
Copy Markdown

GH-14382 is a backport of this pull request to the 3.8 branch.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jun 25, 2019
…pythonGH-14286)

(cherry picked from commit 594d9b9)

Co-authored-by: Pierre Glaser <pierreglaser@msn.com>
miss-islington added a commit that referenced this pull request Jun 25, 2019
…GH-14286)

(cherry picked from commit 594d9b9)

Co-authored-by: Pierre Glaser <pierreglaser@msn.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants